package org.learn.test;

public class OverLoadExercise {
    public static void main(String[] args) {
        Methods m1 = new Methods();
        m1.m(10);
        m1.m(10,23);
        m1.m("韩顺平教育");
        System.out.println(m1.max(10,278));
        System.out.println(m1.max(10.0,2.6));
        System.out.println(m1.max(10.0,2.6,3.4));
    }
}
class Methods {
    public void m(int n1) {
        System.out.println("平方=" + n1 * n1);
    }

    public void m(int n1, int n2) {
        System.out.println("相乘=" + n1 * n2);
    }

    public void m(String a) {
        System.out.println("传入的a=" + a);
    }

    public int max(int a, int b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    public double max(double a, double b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }
    public double max(double a,double b,double c) {
        if (a > b) {
            if (a > c) {
                return a;
            } else {
                return c;
            }
        } else {
            if (b > c) {
                return b;
            } else {
                return c;
            }
        }
    }
}
